package com.fms.gui.templateCreator;

import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JPanel;

import junit.framework.TestCase;

import com.fms.gui.util.componentBuilder.ComponentBuilder;

public class ComponentBuilderTest extends TestCase
{
	
	
	public void testComponentBuilder()
	{
		ComponentBuilder builder = new ComponentBuilder();
		
		JComponent a = new JButton();
		JComponent b = new JLabel();
		JComponent c = new JPanel();
		
		builder.register("A", a);
		builder.register("B", b);
		builder.register("C", c);
		
		
		assertTrue("No button found!", builder.fetch("A").equals(a));
		assertTrue("No label found!", builder.fetch("B").equals(b));
		assertTrue("No panel found!", builder.fetch("C").equals(c));
		assertTrue("No label found!", builder.fetch("B").equals(b));
		
		
	}
}
